#include<iostream>

using namespace std;

typedef struct TreeNode
{
    double data;
    TreeNode* Left;
    TreeNode* Right;  
}TreeNode;
class BiTree
{
    public:
        BiTree(){this->Root=Create(Root,0);}
        ~BiTree(){Release(this->Root);}
        TreeNode* Create(TreeNode *node,double w);
        void Release(TreeNode *node);
        void PreOrder(TreeNode *node);
        TreeNode* Root;
};



int main()
{
    BiTree T;
    T.PreOrder(T.Root);
    return 0;
}
TreeNode* BiTree::Create(TreeNode *node,double w)
{
    node=new TreeNode;
    node->data=w;
    if(w==-1){
        node=NULL;
    }else{
        node->Left=Create(node->Left,-1);
        node->Right=Create(node->Right,-1);
    }
    return node;
}
void BiTree::Release(TreeNode *node)
{
    if(node!=NULL){
        Release(node->Left);
        Release(node->Right);
        delete node;
    }
}
void BiTree::PreOrder(TreeNode *node)
{
    if(node==NULL)return;
    else{
        cout<<node->data;
        PreOrder(node->Left);
        PreOrder(node->Right);
    }
}